package main

import "github.com/gin-gonic/gin"
import  "goDemo/router"

func main() {
	r := gin.Default()
	// 全局中间件
	// 使用 Logger 中间件
	r.Use(gin.Logger())

	// 使用 Recovery 中间件
	r.Use(gin.Recovery())

	//r.Use(gin.BasicAuth(gin.Accounts{"taofu":"123"}))

	r.GET("/user",router.User)
	r.GET("/add",router.Add)
	r.GET("/conn",router.Conn)
	r.Run() // listen and serve on 0.0.0.0:8080
}